//
//  MineHeadTableViewCell.m
//  BaChat
//
//  Created by dllo on 16/6/13.
//  Copyright © 2016年 刘洋. All rights reserved.
//

#import "MineHeadTableViewCell.h"

@implementation MineHeadTableViewCell

-(void)dealloc
{
    [_headPic release];
    [_QRcode release];
    [_arrow release];
    [_userName release];
    [_baChatNum release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createDiscovery];
    }
    return self;
}

-(void)createDiscovery
{
    self.headPic = [[UIImageView alloc] init];
    self.headPic.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.headPic];
    [self.headPic release];
    
    self.QRcode = [[UIImageView alloc] init];
    self.QRcode.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:self.QRcode];
    [self.QRcode release];
    
    self.arrow = [[UIImageView alloc] init];
    self.arrow.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:self.arrow];
    [self.arrow release];
    
    self.userName = [[UILabel alloc] init];
    self.userName.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.userName];
    [self.userName release];
    
    self.baChatNum = [[UILabel alloc] init];
    self.baChatNum.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:self.baChatNum];
    [self.baChatNum release];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.headPic.frame = CGRectMake(10, 10, ROOTWIDTH / 5.5, ROOTWIDTH / 5.5);
    self.userName.frame = CGRectMake(ROOTWIDTH / 5.5 + 20, 10, ROOTWIDTH / 5.5 * 2, ROOTWIDTH / 5.5 / 2);
    self.baChatNum.frame = CGRectMake(ROOTWIDTH / 5.5 + 20, ROOTWIDTH / 5.5 /2 + 10, ROOTWIDTH / 5.5 * 2, ROOTWIDTH / 5.5 / 2);
    self.QRcode.frame = CGRectMake(ROOTWIDTH - 75, ROOTWIDTH / 5.5 / 3, ROOTWIDTH / 5.5 / 2, ROOTWIDTH / 5.5 / 2);
    self.arrow.frame = CGRectMake(ROOTWIDTH - 30, ROOTWIDTH / 5.5 / 3, ROOTWIDTH / 5.5 / 3, ROOTWIDTH / 5.5 / 2);
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
